#define DEBUG
#include <cstdio>
#include <cmath>

using namespace std;

const int maxn=500000, inf=0x7ffffff;

int min(int a, int b) {
  return a<b ? a : b;
}

int max(int a, int b) {
  return a>b ? a : b;
}

void solve1(int l, int r, int x, int y, int *h, double *ans) {
  if (l>r || x>y) {
    return;
  } else {
    int mid=(x+y)/2, k=0;
    for (int i=l; i<=min(mid, r); i++) {
      if (ans[mid]<h[i]-h[mid]+sqrt(mid-i)) {
	ans[mid] = h[i]-h[mid]+sqrt(mid-i);
	k = i;
      }
    }
    solve1(l, k, x, mid-1, h, ans);
    solve1(k, r, mid+1, y, h, ans);
  }
}

void solve2(int l, int r, int x, int y, int *h, double *ans) {
  if (l>r || x>y) {
    return;
  } else {
    int mid=(x+y)/2, k=0;
    for (int i=max(mid, l); i<=r; i++) {
      if (ans[mid]<h[i]-h[mid]+sqrt(i-mid)) {
	ans[mid] = h[i]-h[mid]+sqrt(i-mid);
	k = i;
      }
    }
    solve2(l, k, x, mid-1, h, ans);
    solve2(k, r, mid+1, y, h, ans);
  }
}

int main() {
#ifdef DEBUG
  freopen("2157.in", "r", stdin);
  freopen("2157.out", "w", stdout);
#endif

  static int h[maxn+1];
  static double ans[2][maxn+1];
  int n;
  scanf("%d", &n);
  for (int i=1; i<=n; i++) {
    scanf("%d", h+i);
    ans[0][i] = ans[1][i] = -inf;
  }

  solve1(1, n, 1, n, h, ans[0]);
  solve2(1, n, 1, n, h, ans[1]);

  for (int i=1; i<=n; i++) {
    printf("%d\n", max(max(ceil(ans[0][i]), ceil(ans[1][i])), 0));
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
